import { createApp } from 'vue'

import ElementPlus from 'element-plus'
import * as ElementPlusIconsVue from '@element-plus/icons-vue'
import 'element-plus/dist/index.css'
import App from './App.vue'
import axios from 'axios'
import {router} from "./router/index.js";
import piniaPersistedState from "pinia-plugin-persistedstate"
import { createPinia } from "pinia";
import './style.css'
const pinia = createPinia()
const app = createApp(App)
// 是否在启动时生成生产提示
app.config.productionTip = false
//将axios进行全局设置
app.config.globalProperties.$axios = axios
// 指定 axios 的全局配置，指定为后端服务器地址
axios.defaults.baseURL = 'http://localhost:8080/'
pinia.use(piniaPersistedState)
app.use(pinia)
app.use(router)
app.use(ElementPlus)
app.mount('#app')
// 注册所有Element Plus图标
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
    app.component(key, component)
}